<?php



$value = 'https://www.huya.com/'; //二维码内容

$errorCorrectionLevel = 'L';//容错级别

$matrixPointSize = 6;//生成图片大小

//生成二维码图片
include_once '../qrcode/phpqrcode.php';

$QRcode = new QRcode();

$file = time() . '.png';

$QRcode::png($value, $file, $errorCorrectionLevel, $matrixPointSize, 2);

$data['qrcodeData'] = 'http:127.0.0.3/' . $file;

$data['link'] = $value;

return $data;